package com.lggry.polymorphsm2;

public class Test {
    public static void main(String[] args) {
        //目标：认识多态的代码
        Animal a1 = new Wolf();

        //强制类型转换
        Snake s1 = (Snake) a1;

//        a1.run();
        Animal a2 = new Snake();
//        a2.run();
        go(a1);
        go(a2);
    }
    public static void go(Animal animal){
        animal.run();
    }
}
